import Vue from 'vue'
import index from './index.vue'
import axios from 'axios'
import store from './vuexText/startValues'
import router from './router/index'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import resource from 'vue-resource'

Vue.config.productionTip = false
Vue.use(resource);
Vue.use(ElementUI);

new Vue({
    router,
    render: h => h(index),
}).$mount('#app')
axios.interceptors.request.use(function (config) { // 这里的config包含每次请求的内容
    if (store.getters.getToken) {
        config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
    }
    return config
},
function(err) {
    return Promise.reject(err)
})
